Node

A base DOM object providing access to the common DOM object properties and methods to manage the DOM node structure.

Inheritors

Properties

Link copied to clipboard

Returns the next node in the document tree, if any.

Link copied to clipboard

Returns the parent of this node, if any.

Link copied to clipboard

Returns the previous node in the document tree, if any.

Link copied to clipboard

Returns XPathExpression that represents path to this Node, or an empty expression if it is not available.

Functions

Link copied to clipboard
abstract fun addEventListener(eventType: EventType, listener: Observer<Event>, useCapture: Boolean)
Adds the given listener to the event target.
Link copied to clipboard
abstract fun appendChild(childNode: Node): Boolean
Adds the given node as a child of the current node to the end of its children list.
Link copied to clipboard
abstract fun children(): List<Node>
Returns an immutable list of all children of this node.
Link copied to clipboard
abstract fun click()
Simulates a click on the node.
Link copied to clipboard
abstract fun close()
Closes this node.
Link copied to clipboard
abstract fun compareDocumentPosition(otherNode: Node): Set<DocumentPosition>
Compares position of the current node against another node in a DOM tree.
Link copied to clipboard
abstract fun dispatch(event: Event): Boolean
Dispatches the given event at the current event target.
Link copied to clipboard
abstract fun document(): Document
Returns the Document instance of this node.
Link copied to clipboard
abstract fun evaluate(expression: String): XPathResult
Evaluates the given XPath expression for the node and returns the XPathResult of the ANY type.
abstract fun evaluate(expression: String, type: XPathResultType): XPathResult
Evaluates the given XPath expression for the node and returns the XPathResult object of the given type.
Link copied to clipboard

Evaluates the given expression for the node and returns XPathResult of the XPathResultType.ANY type.

fun Node.evaluate(expression: XPathExpression, type: XPathResultType): XPathResult
fun Node.evaluate(expression: XPathExpression, type: XPathResultType): XPathResult

Evaluates the given expression for the node and returns XPathResult of the given type.

Link copied to clipboard
abstract fun eventListeners(eventType: EventType, useCapture: Boolean): List<Observer<Event>>
Returns the immutable list of event listeners that listen events of the given eventType in a phase that corresponds the given useCapture.
Link copied to clipboard

Returns the first Element found in the current search context by the given className, if any.

Link copied to clipboard

Returns the first Element found in the current search context by the given cssSelector, if any.

Link copied to clipboard

Returns the first Element found in the current search context by the given id, if any.

Link copied to clipboard

Returns the first Element found in the current search context by the given name, if any.

Link copied to clipboard

Returns the first Element found in the current search context by the given tagName, if any.

Link copied to clipboard
abstract fun findElementByClassName(className: String): Optional<Element>
Returns the first Element object found in the current search context by the given className.
Link copied to clipboard
abstract fun findElementByCssSelector(cssSelector: String): Optional<Element>
Returns the first Element object found in the current search context by the given cssSelector.
Link copied to clipboard
Returns the first Element object found in the current search context by the given id.
Link copied to clipboard
Returns the first Element object found in the current search context by the given name.
Link copied to clipboard
abstract fun findElementByTagName(tagName: String): Optional<Element>
Returns the first Element object found in the current search context by the given tagName.
Link copied to clipboard
abstract fun findElementsByClassName(className: String): List<Element>
Returns an immutable list of the Element objects found in the current search context by the given className.
Link copied to clipboard
abstract fun findElementsByCssSelector(cssSelector: String): List<Element>
Returns an immutable list of the Element objects found in the current search context by the given cssSelector.
Link copied to clipboard
abstract fun findElementsById(id: String): List<Element>
Returns an immutable list of the Element objects found in the current search context by the given id.
Link copied to clipboard
abstract fun findElementsByName(name: String): List<Element>
Returns an immutable list of the Element objects found in the current search context by the given name.
Link copied to clipboard
abstract fun findElementsByTagName(tagName: String): List<Element>
Returns an immutable list of the Element objects found in the current search context by the given tagName.
Link copied to clipboard

Returns the first Element found in the current search context by the given className.

Link copied to clipboard

Returns the first Element found in the current search context by the given cssSelector.

Link copied to clipboard

Returns the first Element found in the current search context by the given id.

Link copied to clipboard

Returns the first Element found in the current search context by the given name.

Link copied to clipboard

Returns the first Element found in the current search context by the given tagName.

Link copied to clipboard
abstract fun insertChild(node: Node, beforeNode: Node): Boolean
Inserts the given node before the given beforeNode as a child of the current node.
Link copied to clipboard
abstract fun nextSibling(): Optional<Node>
Returns an Optional that contains the next node in the document tree if such a node exists, otherwise returns an empty Optional.
Link copied to clipboard
abstract fun nodeName(): String
Returns a string that represents the node name in the UTF8 format.
Link copied to clipboard
abstract fun nodeValue(): String
Returns a string that represents the node value.
abstract fun nodeValue(value: String)
Updates the node value with the given new value.
Link copied to clipboard
abstract fun parent(): Optional<Node>
Returns an Optional that contains the parent of this node.
Link copied to clipboard
abstract fun previousSibling(): Optional<Node>
Returns an Optional that contains the previous node in the document tree if such a node exists, otherwise returns an empty Optional.
Link copied to clipboard
abstract fun removeChild(childNode: Node): Boolean
Removes the given childNode of the current node from the DOM.
Link copied to clipboard
abstract fun removeEventListener(eventType: EventType, listener: Observer<Event>, useCapture: Boolean)
Removes the given listener from the event target.
Link copied to clipboard
abstract fun replaceChild(newNode: Node, oldNode: Node): Boolean
Replaces the given child oldNode of the current node with the given newNode.
Link copied to clipboard
abstract fun textContent(): String
Returns the text content of the current node and its descendants.
abstract fun textContent(textContent: String)
Removes all the current node children and replaces them with a single text node with the given textContent.
Link copied to clipboard
abstract fun type(): NodeType
Returns the node type.
Link copied to clipboard
abstract fun xPath(): String
Returns a string that represents XPath to the current Node or an empty string if it is not available.